package com.xhs.design.adapter.impl;

import com.xhs.design.adapter.ApiAdapter;
import com.xhs.service.AdapterV1Service;

import javax.servlet.http.HttpServletRequest;

/**
 * @desc: v1版本的接口
 * @projectName: tools-parent
 * @author: xhs
 * @date: 2022/12/5 11:05
 * @version: JDK 1.8
 */
public class ApiV1AdapterImpl implements ApiAdapter {

    @Override
    public boolean supports(Object object) {
        return object instanceof AdapterV1Service;
    }

    @Override
    public Object handle(HttpServletRequest httpServletRequest, Object object) {
        AdapterV1Service apiV1Service = (AdapterV1Service) object;
        Object info = apiV1Service.getInfo();
        return info;
    }
}
